<?php
// 本类由系统自动生成，仅供测试用途
class ArticleAction extends HomeAction {
    
    public function index(){
        
        $share=M('Article');  
        $data['state'] = 2 ;
        import("@.ORG.Page");       //导入分页类
        $count =$share->where($data)->count();//计算总数
        $p = new Page($count, 20);
        $field='aid,uid,group_id,create_time,uname,name,content,group_name,use_count,useless_count,state';
        $sharelist=$share->where($data)->field($field)->group('aid')->limit($p->firstRow . ',' . $p->listRows)->order('aid desc')->select();
    
        // dump($sharelist);
         $p->setConfig('header', '条据');
         $p->setConfig('first', '<li>44</li>');
        
         $p->setConfig('last', '<li></li>');
         $page = $p->show();
         // dump($page);
         $this->assign("page", $page);
         $this->assign('article_list',$sharelist);
         $this->display('Index:article_list');
    }
   
}